class Student:
    school = 'aaa'

    def __init__(self, xm, age):
        self.name = xm
        self.age = age

    def show(self):
        print(f'my name is {self.name},age is {self.age}')

# 动态绑定属性
stu=Student('chl',18)
print(stu.name, stu.age)
stu.gender='m'
print(stu.gender)

# 动态绑定方法
def fun():
    print("这是一个函数，可以动态绑定到任何对象上")

stu.introduce=fun
stu.introduce()